<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Gets the level(s) currently being logged</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongolog.getcallback.html">« MongoLog::getCallback</a></li>
      <li style="float: right;"><a href="mongolog.getmodule.html">MongoLog::getModule »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.mongolog.html">MongoLog</a></li>
    <li>Gets the level(s) currently being logged</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongolog.getlevel" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoLog::getLevel</h1>
  <p class="verinfo">(PECL mongo &gt;= 1.2.3)</p><p class="refpurpose"><span class="refname">MongoLog::getLevel</span> &mdash; <span class="dc-title">Gets the level(s) currently being logged</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongolog.getlevel-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>MongoLog::getLevel</strong></span>(): <span class="type">int</span></div>

  <p class="para rdfs-comment">
   This function can be used to see which log levels are currently enabled.
   The returned integer may be compared with the
   <a href="class.mongolog.html#mongolog.constants.level" class="link">MongoLog level constants</a>
   using bitwise operators to check for specific log levels.
  </p>
  <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">getLevel</span><span style="color: #007700">()&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">FINE</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"lots&nbsp;of&nbsp;logs\n"</span><span style="color: #007700">;<br />}<br /><br />if&nbsp;(</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">getLevel</span><span style="color: #007700">()&nbsp;^&nbsp;</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">NONE</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"logging,&nbsp;at&nbsp;least&nbsp;a&nbsp;little\n"</span><span style="color: #007700">;<br />}<br /><br />if&nbsp;(</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">getLevel</span><span style="color: #007700">()&nbsp;==&nbsp;</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">ALL</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"logging&nbsp;at&nbsp;the&nbsp;highest&nbsp;levels\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
  </div>

 </div>


 <div class="refsect1 parameters" id="refsect1-mongolog.getlevel-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongolog.getlevel-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the level(s) currently being logged.
  </p>
 </div>


</div></div></div></body></html>